package ligne2vie.topos.server.service;

import java.util.ArrayList;
import java.util.List;

import ligne2vie.topos.server.bo.Summit;
import ligne2vie.topos.shared.bo.TSummit;

/**
 * Convenience class providing different useful conversion methods.
 * 
 * @author thuguerre
 * @since 1.0.0
 */
public final class Conversion {

	/**
	 * Convert a list of {@link Summit} into a list of {@link TSummit}.
	 * 
	 * @param summits
	 *            List to convert.
	 * @return Converted list.
	 */
	public static List<TSummit> toTSummitList(List<Summit> summits) {

		if (summits == null) {

			return null;

		} else {

			List<TSummit> result = new ArrayList<TSummit>();
			for (Summit summit : summits) {
				result.add(summit.getTSummit());
			}
			return result;
		}
	}
}
